package com.itheima.genericityclass;

import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;

public class GenericityMethod {

    public static void main(String[] args) {
        //泛型限定是引用数据类型,基本数据类型不可以作为泛型
        Integer[] arr = {11,22,33,44,55,66,77};
        printArry(arr);
    }

    public static <E> void printArry(E[] arr) {
        if (arr.length == 0){
            System.out.println("[]");
            return;
        }
        System.out.print("[");
        for (int i = 0; i < arr.length - 1; i++) {
            System.out.println(arr[i] + ", ");
        }
        System.out.println(arr[arr.length-1] + "]");
    }
}
